|
AT-NFC
2.1 (win)
AT-NFC kernel set
|
HAL Trace API declarations. More...
Macros | |
| #define | KER_DBG_LEVEL_ERR 0 |
| #define | KER_DBG_LEVEL_WARN 2 |
| #define | KER_DBG_LEVEL_TRACE_COMMENT 5 |
| #define | KER_DBG_LEVEL_TAG_LIST 20 |
| #define | KER_DBG_LEVEL_APDU 30 |
| #define | KER_DBG_LEVEL_TAG_INFO 40 |
| #define | KER_DBG_LEVEL_TAG_WARN 100 |
| #define | KER_DBG_LEVEL_ALL 99 |
Functions | |
| KER_BOOL | hal_set_trace_mode (KER_CTX_PARAM KER_BYTE btTraceMode) |
| Set trace mode. More... | |
| KER_BYTE | hal_get_trace_mode (KER_CTX_SINGLE_PARAM) |
| Get trace mode. More... | |
| KER_BOOL | hal_trace_string (KER_CTX_PARAM const KER_CHAR *pchString) |
| Trace povided nul-term string. More... | |
| KER_BOOL | hal_trace_buffer (KER_CTX_PARAM const KER_BYTE *pbtDataBuffer, KER_INT16U usDataBufferSize) |
| Trace povided data buffer. More... | |
| KER_BOOL | hal_trace_time (KER_CTX_SINGLE_PARAM) |
| Trace timestamp. More... | |
| KER_BOOL | hal_keep_trace_time (KER_CTX_PARAM KER_BYTE *pbtTimeBuffer, KER_INT16U *pusTimeBufferSize) |
| Keep trace timestamp. More... | |
| KER_BOOL | hal_trace_flush (KER_CTX_SINGLE_PARAM) |
| Flush trace to trace file (optional) More... | |
| KER_BOOL | hal_error (KER_CTX_PARAM KER_INT16U usTraceLevel, KER_RES resErrCode, const KER_CHAR *pchErrorText) |
| Trace error to system error journal. More... | |
| KER_VOID | def_hal_trace_supp_app (KER_CTX_PARAM const KER_TLV *pSuppAppList) |
| Default "trace supported applications" implementation. | |
| KER_VOID | def_hal_trace_cl (KER_CTX_PARAM const KER_TLV *pCL) |
| Default "trace candidate list" implementation. | |
| KER_VOID | def_hal_trace_tag (KER_CTX_PARAM const KER_BYTE *pbtTlv, KER_INT16U usTlvLen, KER_INT16U usOrigin) |
| Default "trace obtained tag" implementation. | |
| KER_VOID | def_hal_trace_tvr (KER_CTX_PARAM const KER_CHAR *pchComment, const KER_BYTE *pbtTvr, KER_BYTE btTvrLen) |
| Default "trace TVR" implementation. | |
| #define | KER_TRACE_MODE_STD 0x00 |
| #define | KER_TRACE_MODE_SENS 0x01 |
| #define | KER_TRACE_APDU_REQ_TAB " " |
| #define | KER_TRACE_APDU_INT_REQ_TAB " Int" |
| #define | KER_TRACE_APDU_INT_RESP_TAB " Int" |
| #define | KER_TRACE_APDU_RESP_TAB " " |
| #define | KER_TRACE_COMB_TAB " " |
| #define | KER_DBG_EX(IgnoreLevel, ErrLevel) ((KER_DEBUG == KER_TRUE) && ((KER_DEBUG_LEVEL >= ErrLevel) || (KER_DEBUG_ALL == KER_TRUE) || (IgnoreLevel == KER_TRUE))) |
| #define | KER_DBG(ErrLevel) KER_DBG_EX(KER_FALSE,ErrLevel) |
| #define | KER_INFO KER_DBG_EX(KER_TRUE,0) |
| #define | KER_TRACE_EOL "\r\n" |
| #define | KER_COMMENT_HDR_NO_TIME(comment) |
| Default "trace comment w/o time" macro. More... | |
| #define | KER_COMMENT_HDR_EX(comment) |
| Default "trace comment" macro. More... | |
| #define | KER_COMMENT_FTR_EX(comment) |
| Default "trace comment" macro. More... | |
| #define | KER_COMMENT_HDR_TEXT(text) const KER_CHAR const_ch___CommentHeader[] = text |
| #define | KER_COMMENT_HDR(text) KER_COMMENT_HDR_TEXT(text); KER_COMMENT_HDR_EX(const_ch___CommentHeader) |
| #define | KER_COMMENT_FTR() KER_COMMENT_FTR_EX(const_ch___CommentHeader) |
| #define | KER_COMMENT_TEXT(text) hal_trace_string(KER_CTX text) |
| Default "trace comment" macro. More... | |
| #define | KER_COMMENT(comment) |
| Default "trace comment" macro. More... | |
| #define | KER_COMMENT_TEST_MODE() KER_COMMENT("########################## TEST MODE! ##########################") |
| #define | KER_COMMENT_TEST_MODE_DISABLED() KER_COMMENT("###################### TEST MODE DISABLED ######################") |
| #define | KER_TRACE_TIME() hal_trace_time(KER_CTX_SINGLE) |
| Default "trace comment" macro. More... | |
| #define | KER_COMMENT_HEX(comment_start, buff, buff_len, comment_end) |
| Default "trace comment with hex data" macro. More... | |
| #define | KER_TEXT_HEX(dest, dest_len, buff, buff_len) |
| Default "fill text string with hex data" macro. More... | |
| #define | KER_COMMENT_STR(comment_start, buff, buff_len, comment_end) |
| Default "trace comment with hex data" macro. More... | |
| #define | KER_TRACE_ERR_BUF KER_CHAR ar_ch___ErrBuffer[32]; |
| Default "Declare error trace buffer" macro. | |
| #define | KER_TRACE_SYS_ERR_BUF |
| Default "Declare sys error trace buffer" macro. | |
| #define | KER_TRACE_BUF(Size) KER_CHAR ar_ch___InfBuffer[Size]; |
| Default "Declare trace buffer" macro. | |
| #define | KER_RESET_TRACE_BUF KER_MEM_SET(ar_ch___InfBuffer, sizeof(ar_ch___InfBuffer), 0, sizeof(ar_ch___InfBuffer)); |
| Default "Reset trace buffer" macro. | |
| #define | KER_ERROR(err_code, trace_level, comment) |
| Default "trace error" macro (Release mode) More... | |
| #define | KER_SYS_ERROR(err_code, trace_level, comment) hal_error(KER_CTX trace_level, err_code, comment) |
| Default "trace system error" macro (Release mode - without extra diagnostic info - for PCI) More... | |
| #define | KER_SYS_INFO(err_code, trace_level, comment) hal_error(KER_CTX trace_level, err_code, comment) |
| Default "trace system info" macro. More... | |
| #define | KER_TRACE_TAG_NOT_FOUND(tag, tag_length) |
| Default "trace tag not found" macro. More... | |
| #define | KER_TRACE_TAG_DUPLICATION(tag, tag_length, tlv1, tlv1_length, tlv2, tlv2_length) |
| Default "tag duplication" macro. More... | |
| #define | KER_TRACE_APDU_REQ(bInternal, btCase, btCLA, btINS, btP1, btP2, usLc, pbtData, usLe) |
| Default "trace apdu request" macro. More... | |
| #define | KER_TRACE_APDU_RESP(INTERNAL, SW1SW2, DATA, DATA_LEN) |
| Default "trace apdu response" macro. More... | |
| #define | KER_TRACE_NFC_APDU_RESP(INTERNAL, SW1SW2, EXEC_TIME, DATA, DATA_LEN) |
| Default "trace nfc apdu response" macro. More... | |
| #define | KER_TRACE_SUPP_APP_LIST_DEFAULT /* force to include default implementation - see hal_trace_def.c */ |
| Default "trace supported applications" macro. More... | |
| #define | KER_TRACE_SUPP_AIDS(AidList) def_hal_trace_supp_app(KER_CTX AidList); |
| Default "trace supported aids" macro. | |
| #define | KER_TRACE_CL_DEFAULT /* force to include default implementation - see hal_trace_def.c */ |
| Default "trace candidate list" macro. More... | |
| #define | KER_TRACE_CL(CL) def_hal_trace_cl(KER_CTX CL); |
| Default "trace candidate list" macro. | |
| #define | KER_TRACE_TAG_DEFAULT /* force to include default implementation - see hal_trace_def.c */ |
| Default "trace obtained tag " macro. More... | |
| #define | KER_TRACE_TAG(Tlv, TlvLen, Origin) def_hal_trace_tag(KER_CTX Tlv,TlvLen,Origin) |
| Default "trace tag" macro. | |
| #define | KER_TRACE_CVM_LIST(TranPtr, TrType, TrCurr, IccCurr, AmountX, AmountY) |
| Default "trace cvm list" macro. More... | |
| #define | KER_TRACE_TVR_DEFAULT /* force to include default implementation - see hal_trace_def.c */ |
| Default "trace TVR/TAC/IAC " macro. More... | |
| #define | KER_TRACE_TVR(Comment, Tvr, TvrLen) def_hal_trace_tvr(KER_CTX Comment, Tvr, TvrLen) |
| Default "trace TVR" macro. | |
| #define | KER_TRC_STD hal_set_trace_mode(KER_CTX KER_TRACE_MODE_STD); |
| Set standard trace mode macro. | |
| #define | KER_TRC_SENS hal_set_trace_mode(KER_CTX KER_TRACE_MODE_SENS); |
| Set sensitive trace mode macro. | |
| #define | KER_TRC_S hal_sprintf(KER_CTX ar_ch___InfBuffer,sizeof(ar_ch___InfBuffer), |
| Open sprintf block macro. | |
| #define | KER_TRC_E ); hal_trace_string(KER_CTX ar_ch___InfBuffer); |
| Close sprintf block macro. | |
| #define | KER_TRC_NL hal_trace_string(KER_CTX KER_TRACE_EOL); |
| Trace new line macro. | |
| #define | KER_TRC_TIME hal_trace_time(KER_CTX_SINGLE); |
| Trace timestamp macro. | |
HAL Trace API declarations.
This functions should be implemented by terminal application
| #define KER_COMMENT | ( | comment | ) |
Default "trace comment" macro.
Redefine this macro to trace all comments (recommended for debug only)
| #define KER_COMMENT_FTR | ( | ) | KER_COMMENT_FTR_EX(const_ch___CommentHeader) |
default trace footer text macro
| #define KER_COMMENT_FTR_EX | ( | comment | ) |
Default "trace comment" macro.
Redefine this macro to trace all comments (recommended for debug only)
| #define KER_COMMENT_HDR | ( | text | ) | KER_COMMENT_HDR_TEXT(text); KER_COMMENT_HDR_EX(const_ch___CommentHeader) |
default trace header text macro
| #define KER_COMMENT_HDR_EX | ( | comment | ) |
Default "trace comment" macro.
Redefine this macro to trace all comments (recommended for debug only)
| #define KER_COMMENT_HDR_NO_TIME | ( | comment | ) |
Default "trace comment w/o time" macro.
Redefine this macro to trace all comments (recommended for debug only)
| #define KER_COMMENT_HDR_TEXT | ( | text | ) | const KER_CHAR const_ch___CommentHeader[] = text |
default trace header text macro
| #define KER_COMMENT_HEX | ( | comment_start, | |
| buff, | |||
| buff_len, | |||
| comment_end | |||
| ) |
| #define KER_COMMENT_STR | ( | comment_start, | |
| buff, | |||
| buff_len, | |||
| comment_end | |||
| ) |
Default "trace comment with hex data" macro.
Redefine this macro to trace all comments (recommended for debug only)
| #define KER_COMMENT_TEST_MODE | ( | ) | KER_COMMENT("########################## TEST MODE! ##########################") |
default test mode text macro
| #define KER_COMMENT_TEST_MODE_DISABLED | ( | ) | KER_COMMENT("###################### TEST MODE DISABLED ######################") |
default test mode disabled text macro
| #define KER_COMMENT_TEXT | ( | text | ) | hal_trace_string(KER_CTX text) |
Default "trace comment" macro.
Redefine this macro to trace all comments (recommended for debug only)
| #define KER_DBG | ( | ErrLevel | ) | KER_DBG_EX(KER_FALSE,ErrLevel) |
check trace level simplified macro
| #define KER_DBG_EX | ( | IgnoreLevel, | |
| ErrLevel | |||
| ) | ((KER_DEBUG == KER_TRUE) && ((KER_DEBUG_LEVEL >= ErrLevel) || (KER_DEBUG_ALL == KER_TRUE) || (IgnoreLevel == KER_TRUE))) |
check trace level macro
| #define KER_DBG_LEVEL_ALL 99 |
Trace all
| #define KER_DBG_LEVEL_APDU 30 |
Trace APDU
| #define KER_DBG_LEVEL_ERR 0 |
Trace errors
| #define KER_DBG_LEVEL_TAG_INFO 40 |
Trace tag related info
| #define KER_DBG_LEVEL_TAG_LIST 20 |
Trace tag list
| #define KER_DBG_LEVEL_TAG_WARN 100 |
Trace/convert tag warnings
| #define KER_DBG_LEVEL_TRACE_COMMENT 5 |
Trace comments
| #define KER_DBG_LEVEL_WARN 2 |
Trace warnings
| #define KER_ERROR | ( | err_code, | |
| trace_level, | |||
| comment | |||
| ) |
Default "trace error" macro (Release mode)
Default trace error with ansi string comment buffer macro (without diagnostic info - for PCI)
| #define KER_INFO KER_DBG_EX(KER_TRUE,0) |
check info trace macro
| #define KER_SYS_ERROR | ( | err_code, | |
| trace_level, | |||
| comment | |||
| ) | hal_error(KER_CTX trace_level, err_code, comment) |
Default "trace system error" macro (Release mode - without extra diagnostic info - for PCI)
Default trace system error with ansi string comment buffer macro Do not trace anything to transaction log (it may not exist yet)!
| #define KER_SYS_INFO | ( | err_code, | |
| trace_level, | |||
| comment | |||
| ) | hal_error(KER_CTX trace_level, err_code, comment) |
Default "trace system info" macro.
Default trace system info with ansi string comment buffer macro Do not trace anything to transaction log (it may not exist yet)!
| #define KER_TEXT_HEX | ( | dest, | |
| dest_len, | |||
| buff, | |||
| buff_len | |||
| ) |
Default "fill text string with hex data" macro.
| #define KER_TRACE_APDU_INT_REQ_TAB " Int" |
APDU request trace shift
| #define KER_TRACE_APDU_INT_RESP_TAB " Int" |
APDU response trace shift
| #define KER_TRACE_APDU_REQ | ( | bInternal, | |
| btCase, | |||
| btCLA, | |||
| btINS, | |||
| btP1, | |||
| btP2, | |||
| usLc, | |||
| pbtData, | |||
| usLe | |||
| ) |
Default "trace apdu request" macro.
Redefine this macro to trace all apdu requests, which were sent by kernel (for debug only)
| #define KER_TRACE_APDU_REQ_TAB " " |
APDU request trace shift
| #define KER_TRACE_APDU_RESP | ( | INTERNAL, | |
| SW1SW2, | |||
| DATA, | |||
| DATA_LEN | |||
| ) |
Default "trace apdu response" macro.
Redefine this macro to trace all apdu responses, which were sent by card (for debug only)
| #define KER_TRACE_APDU_RESP_TAB " " |
APDU response trace shift
| #define KER_TRACE_CL_DEFAULT /* force to include default implementation - see hal_trace_def.c */ |
Default "trace candidate list" macro.
Redefine this macro to trace cl
| #define KER_TRACE_COMB_TAB " " |
Combination related info trace shift
| #define KER_TRACE_CVM_LIST | ( | TranPtr, | |
| TrType, | |||
| TrCurr, | |||
| IccCurr, | |||
| AmountX, | |||
| AmountY | |||
| ) |
Default "trace cvm list" macro.
Redefine this macro to trace cvm list from icc
| #define KER_TRACE_EOL "\r\n" |
default eol macro
| #define KER_TRACE_MODE_SENS 0x01 |
Trace sensitive data
| #define KER_TRACE_MODE_STD 0x00 |
STD Trace (skip sensitive data)
| #define KER_TRACE_NFC_APDU_RESP | ( | INTERNAL, | |
| SW1SW2, | |||
| EXEC_TIME, | |||
| DATA, | |||
| DATA_LEN | |||
| ) |
Default "trace nfc apdu response" macro.
Redefine this macro to trace all apdu responses, which were sent by card (for debug only)
| #define KER_TRACE_SUPP_APP_LIST_DEFAULT /* force to include default implementation - see hal_trace_def.c */ |
Default "trace supported applications" macro.
Redefine this macro to trace all supported by terminal applications
| #define KER_TRACE_TAG_DEFAULT /* force to include default implementation - see hal_trace_def.c */ |
Default "trace obtained tag " macro.
Redefine this macro to trace tag added
| #define KER_TRACE_TAG_DUPLICATION | ( | tag, | |
| tag_length, | |||
| tlv1, | |||
| tlv1_length, | |||
| tlv2, | |||
| tlv2_length | |||
| ) |
| #define KER_TRACE_TAG_NOT_FOUND | ( | tag, | |
| tag_length | |||
| ) |
| #define KER_TRACE_TIME | ( | ) | hal_trace_time(KER_CTX_SINGLE) |
Default "trace comment" macro.
Redefine this macro to trace current time (recommended for debug only)
| #define KER_TRACE_TVR_DEFAULT /* force to include default implementation - see hal_trace_def.c */ |
Default "trace TVR/TAC/IAC " macro.
Redefine this macro to trace TVR/TAC/IAC
| KER_BOOL hal_error | ( | KER_CTX_PARAM KER_INT16U | usTraceLevel, |
| KER_RES | resErrCode, | ||
| const KER_CHAR * | pchErrorText | ||
| ) |
Trace error to system error journal.
| [in] | usTraceLevel | trace level (KER_DBG_LEVEL_ERR, etc..) |
| [in] | resErrCode | error code |
| [in] | pchErrorText | nul-term string to trace |
| KER_BYTE hal_get_trace_mode | ( | KER_CTX_SINGLE_PARAM | ) |
Get trace mode.
| KER_BOOL hal_keep_trace_time | ( | KER_CTX_PARAM KER_BYTE * | pbtTimeBuffer, |
| KER_INT16U * | pusTimeBufferSize | ||
| ) |
| KER_BOOL hal_set_trace_mode | ( | KER_CTX_PARAM KER_BYTE | btTraceMode | ) |
Set trace mode.
| [in] | btTraceMode | pass KER_TRACE_MODE_STD to trace standard data and KER_TRACE_MODE_SENS to trace sensitive data |
| KER_BOOL hal_trace_buffer | ( | KER_CTX_PARAM const KER_BYTE * | pbtDataBuffer, |
| KER_INT16U | usDataBufferSize | ||
| ) |
| KER_BOOL hal_trace_flush | ( | KER_CTX_SINGLE_PARAM | ) |
| KER_BOOL hal_trace_string | ( | KER_CTX_PARAM const KER_CHAR * | pchString | ) |
| KER_BOOL hal_trace_time | ( | KER_CTX_SINGLE_PARAM | ) |